<?php

namespace services\user\models;

use Yii;

/**
 * This is the model class for table "{{%_users}}".
 *
 * @property string $id 用户ID
 * @property string $username 用户名
 * @property string $password 用户密码
 * @property string $head 用户头像
 * @property string $email 用户邮箱
 * @property string $created_at 创建时间
 * @property int $updated_at 修改时间
 * @property int $status 用户状态
 */
class Users extends \yii\swoole\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%_users}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['username', 'password'], 'required'],
            [['created_at', 'updated_at', 'status'], 'integer'],
            [['username', 'password', 'head', 'email'], 'string', 'max' => 64],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('user', '用户ID'),
            'username' => Yii::t('user', '用户名'),
            'password' => Yii::t('user', '用户密码'),
            'head' => Yii::t('user', '用户头像'),
            'email' => Yii::t('user', '用户邮箱'),
            'created_at' => Yii::t('user', '创建时间'),
            'updated_at' => Yii::t('user', '修改时间'),
            'status' => Yii::t('user', '用户状态'),
        ];
    }
}
